<?php
/*
* @file get user infomation
*
* @author: Selver.Ding
*/
  if (!function_exists('add_action'))
  {
      require_once("../../../wp-config.php");
  }
class AjaxUser {
	function __construct() {
		global $wpdb;
		$this->db=$wpdb;
		date_default_timezone_set('PRC');
	}
	public function getUserInfo($u_id) {
		$table_name = $this->db->prefix . 'users';
		$sql = "SELECT `user_email`,`user_url`,`user_registered`,`display_name` FROM $table_name WHERE `ID` = $u_id";
		$result = $this->db->get_results($sql,ARRAY_A);
        foreach($result as $key=>$r)
        {
            $result[$key]['user_registered']=date('F j, Y g:i A',mktime($result[$key]['user_registered']));
        }

		echo (json_encode($result));
	}
}
$u_id = $_GET['u_id'];
$usernfo = new AjaxUser();
$usernfo->getUserInfo($u_id);
?>